﻿using Host.Domain;
using Host.InfrasIntructure.Interface;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Host.InfrasIntructure.Implement
{
    public class EFCoreDeviceRepository : BaseRepository<Devices>, IEFCoreDeviceRepository
    {
        private readonly HostDbContext _dbContext;

        public EFCoreDeviceRepository(HostDbContext dbContext) : base(dbContext)
        {
            _dbContext = dbContext;
        }

        public async Task<List<Devices>> GetAllByStationIdAsync(int stationId)
        {
            return await _dbContext.Set<Devices>().Where(d => d.StationId == stationId).ToListAsync();
        }
    }
}
